$(function(){
	$(".thinLineTable tbody tr").each(function(){
		$(this).hover(
			function(){
				$(this).addClass("trow3");
			},
			function(){
				$(this).removeClass("trow3");
			}
		);
		
	});
	$("#ok").live("click",function(){
		parent.window.location.reload();
	});
	$("#close").live("click",function(){
		parent.$.fancybox.close();
	});
	//收缩和展开
	$("#logo").toggle(
		function(){
			$(".left").fadeOut("fast",function(){
				$(".main").animate({width: "100%"}, 200);
			}); 
		},
		function(){
			$(".main").animate({width: "85%"}, 200,function(){
				$(".left").fadeIn("fast");
			});
		}
	);
	setMenu();
});
//添加样式
function setMenu(){
	var url = window.location;
	url = subUrl(url.toString());
	$(".menu li > a").each(function(){
		var a_href = subUrl($(this).attr('href'));
		if(a_href == url.substring(0,a_href.length)){
			$(this).css('color','red');
		}
	});
}
//处理url
function subUrl(url){
	var temp = url.match(/^(http:\/\/.[^\/]*)(.*?)([^\/]*)$/);
	if(temp == null){
		return url;	
	}
	var len = temp.length;
	return temp[len -2] + temp[len -1];
}
function succeed_info(msg){
	$(".wapper").html("<h2>提示信息</h2>"+
            "<div class=\"view\">"+
            	"<div style=\"text-align: center;\">"+
            		"<label><img alt=\"成功\" src=\"../res/images/ico-success.gif\"></label>"+
            		"<span style=\"float:right;font-size: 16px; font-weight: bold; color: green; margin-right:40%; margin-top:6%;\">"+msg+"</span>"+
            	"</div>"+
            	"<div class=\"btn-div\" style=\"text-align: center;\"><button type=\"button\" id=\"ok\">确定</button></div>"+
            "</div>");
	box_info();
}
function error_info(msg){
	$(".wapper").html("<h2>提示信息</h2>"+
            "<div class=\"view\">"+
            	"<div style=\"text-align: center;\">"+
            		"<label><img alt=\"成功\" src=\"../res/images/ico-error.gif\"></label>"+
            		"<span style=\"float:right;font-size: 16px; font-weight: bold; color: green; margin-right:40%; margin-top:6%;\">"+msg+"</span>"+
            	"</div>"+
            	"<div class=\"btn-div\" style=\"text-align: center;\"><button type=\"button\" id=\"close\">确定</button></div>"+
            "</div>");
	box_info();
}